<?php 
      echo $this->Html->css("chosen");
      echo $this->Html->css("dataTables");
      echo $this->Html->css("validationEngine.jquery");
 ?>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/dataTables.min.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/customInput.jquery.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/chosen.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/zice.custom1.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/ColVis.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/accounting.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/layout_table.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/manager_deliverys.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.validationEngine.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.validationEngine-vi.js"></script>
<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.autotab.js"></script>

<div class="titlePage">
<h1>Quản lý hóa đơn - Hóa đơn Giao hàng</h1>
</div>

<div class="onecolumn">
	<div class="header">
	<span>
		<span class="ico gray window"></span>
		Tìm kiếm hóa đơn
	</span>
	</div>
	<div class="clear"></div>
	<div class="content" style="display: inline-block; width: 95%;">
		<form id="formSearch" method="post" action="">
			<div class="section">
				<label> Mã HĐ :</label>   
                <input type="text" name="idInvoice" class='validate[custom[number]]' />
            </div>
			<div class="section" style="float:left;margin-right: 5%; border-bottom: none;">
				<label>
				Chọn xe:				
				</label>
				<div id="search_car" >
					<select class="choose_car" name="choose_car">
					<option></option>
						<option></option>
                          <?php foreach ($list_car as $item) {?>
							<option value="<?php echo $item['c']['id']; ?>"><?php echo $item['c']['number'];}?></option>
                     </select>
					
				</div>
			</div>
			<div class="section" style="float:left;margin-right: 5%; border-bottom: none;">
				<label>
				Chọn tài xế:				
				</label>
				<div id="search_driver" >
					<select class="choose_driver" name="choose_driver">
					<option></option>
						<option></option>
                          <?php foreach ($list_driver as $item) {?>
							<option value="<?php echo $item['e']['id']; ?>"><?php echo $item['e']['name'];}?></option>
                     </select>
					
				</div>
			</div>
			<div class="section " style="float:left;margin-right: 4% ;border-bottom: none;">
				<label>
				Chọn lơ xe:				
				</label>
				<div id="search_transfomer1" >
					<select class="choose_transfomer1" name="choose_transfomer1">
					<option></option>
						<option></option>
                          <?php foreach ($list_transfomer as $item) {?>
							<option value="<?php echo $item['e']['id']; ?>"><?php echo $item['e']['name'];}?></option>
                     </select>
				</div>
			</div>
            <div class="section" style="float:left; border-bottom: none; width: 25%;">
                <label>Ngày giao: </label>   
                <div>Từ <input type="text" id="dateStart" class="dateStart" name="dateStart"  /></div>
                <div>đến <input type="text" id="dateEnd" class="dateEnd" name="dateEnd"  /></div>
            </div>
            <input type="hidden"  id="isSearch" class="isSearch" name="isSearch" value="1"/>  
            <div class="buttonSearchInvoice" style="text-align: center;">
				<a class="uibutton" id='search_invoice'><span class="ico gray checkmark2"></span>Tìm kiếm</a>
				<div id='alert_mes'></div>
			</div>
		</form>
	</div>
</div>
<?php if($isSearch){?>
<div class="onecolumn deInvoice">
	<div class="header">
	<span>
		<span class="ico gray spreadsheet"></span>
		DANH SÁCH HÓA ĐƠN
	</span>
	</div>
	<div class="clear"></div>
	<div class="content">
		<div id="uploadTab">
            <ul class="tabs" >
                   <li ><a href="#tab3"   >   Tất cả  </a></li>  
                   <li ><a href="#tab4"   >   Chưa kiểm tra  </a></li>            
            </ul>
	        <div class="tab_container" >
	        	<div id="tab3" class="tab_content"> 
                	<div class="load_page">
                		<form>
							<div class="tableName toolbar">
								<table class="display data_table2 listDeInvoice" >
									<thead>
										<tr>
											<th><div class="th_wrapp">Số xe</div></th>
											<th><div class="th_wrapp">Ngày giao</div></th>
										</tr>
									</thead>
									<tbody>
									<?php 
										foreach ($list_invoice as $item) {
									?>
											<tr class="odd gradeX DeInvoice" id="<?php  echo $item['de']['id']; ?>" name="<?php  echo $item['de']['check']; ?>">
						      					<td><?php  echo $item['c']['number'];?></td>
						      					<td><?php  echo date('d/m/Y H:i',strtotime($item['de']['time'])); ?></td>
						      					</tr><?php }?>
					     					
									</tbody>
								</table>
					            </div>
						</form>
                	</div>
                </div>
                <div id="tab4" class="tab_content"> 
                	<div class="load_page">
                		<form>
							<div class="tableName toolbar">
								<table class="display data_table2 listDeInvoice" >
									<thead>
										<tr>
											<th><div class="th_wrapp">Số xe</div></th>
											<th><div class="th_wrapp">Ngày giao</div></th>
										</tr>
									</thead>
									<tbody>
									<?php 
										foreach ($list_invoice_not_check as $item) {
									?>
											<tr class="odd gradeX DeInvoice" id="<?php  echo $item['de']['id']; ?>" name="<?php  echo $item['de']['check']; ?>">
						      					<td><?php  echo $item['c']['number'];?></td>
						      					<td><?php  echo date('d/m/Y H:i:s',strtotime($item['de']['time'])); ?></td>
						      					</tr><?php }?>
					     					
									</tbody>
								</table>
					            </div>
						</form>
                	</div>
                </div>
			</div>
		</div>
		
	</div>
</div>
<div class="onecolumn listDeInvoiceProduct">
<div class="header">
	<span>
		<span class="ico gray paragraph_justify"></span>
		CHI TIẾT HÓA ĐƠN
	</span>
	</div>
	<div class="clear"></div>
	<div class="content">
		<div class="toolbar1"></div>
		<div id="uploadTab">
            <ul class="tabs" >
                   <li ><a href="#tab1"   >   Hóa đơn sỉ  </a></li>  
                   <li ><a href="#tab2"   >   Hóa đơn lẻ  </a></li>            
            </ul>
	        <div class="tab_container" >
				<div id="result_choose_de_invoice">
				
				</div>
			</div>
		</div>
	</div>
</div>
<?php }?>